{include file="../../../application/admin/view/public/head" /}
<div class="page-container p10">

    <div class="my-toolbar-box" >
        <div class="center mb10">
            
        </div>

        <div class="layui-btn-group">
        
        </div>
        <div class="layui-btn-group">
            <a data-href="{:url('saishiinfo')}" data-title="添加赛事置顶" class="layui-btn layui-btn-primary j-iframe" data-width="800px" data-height="600px"><i class="layui-icon">&#xe654;</i>添加赛事置顶</a>
        </div>
    </div>

     <form class="layui-form " method="post" id="pageListFormSaishi">
         <table class="layui-table" lay-size="sm">
            <thead>
            <tr>
                <th width="50">排序</th>
                <th width="100">广告图片</th>
                <th width="80">来源</th>
                <!--<th width="130">跳转链接</th>-->
                <!--<th width="130">跳转方式</th>-->
                <!--<th width="130">广告名称</th>-->
                <th width="240">广告描述</th>
                <th width="80">上推荐/发现</th>
                <th width="80">状态</th>
                <th width="150">操作</th>
            </tr>
            </thead>

            {volist name="saishilist" id="vo"}
            <tr>
                <td><input type="text" value="{$vo.saishishunxu}" data-shunxu="saishishunxu" data-id="{$vo.id}" class="layui-input shunxu" /></td>
                <td><img src="{$vo.pic}" style="border-radius: 0px;" /></td>
                <!--<td>{$vo.jumpurl}</td>-->
                <!--<td>-->
                <!--    {if condition="$vo.jumpstatus eq 0"}-->
                <!--        <font color="#666">App内</font>-->
                <!--    {/if}-->
                <!--    {if condition="$vo.jumpstatus eq 1"}-->
                <!--        <font color="#666">App外</font>-->
                <!--    {/if}-->
                <!--</td>-->
                <td><span data-type_id="{$vo.type_id}"></span></td>
                <!--<td>{$vo.adname}</td>-->
                <td>
                    
                    {if condition="$vo.isxiajia eq 0"}
                        <font color="red">直播结束</font>
                    {/if}
                    {$vo.desc}</td>
                <td>
                    {if condition="$vo.from eq 0"}
                        <font color="#999">关闭</font>
                    {/if}
                    {if condition="$vo.from eq 1"}
                        <font color="green">开启</font>
                    {/if}
                    {if condition="$vo.isxiajia eq 1"}
                    <a class="layui-btn layui-btn-xs changeFrom" href="javascript:;;" data-from="{$vo.from}" data-id="{$vo.id}">改状态</a>
                    {/if}
                </td> 
                <td>
                    {if condition="$vo.status eq 0"}
                        <font color="#999">关闭</font>
                    {/if}
                    {if condition="$vo.status eq 1"}
                        <font color="green">开启</font>
                    {/if}
                    {if condition="$vo.isxiajia eq 1"}
                    <a class="layui-btn layui-btn-xs changeStatus" href="javascript:;;" data-status="{$vo.status}" data-id="{$vo.id}">改状态</a>
                    {/if}
                </td>
                <td>
                    {if condition="$vo.isxiajia eq 1"}
                    <a class="layui-badge-rim j-iframe" data-title="编辑赛事置顶" data-width="800px" data-height="600px"  data-href="{:url('saishiinfo?id='.$vo['id'])}" href="javascript:;" title="编辑">编辑</a>
                    {/if}
                    <a class="layui-badge-rim j-tr-del" data-href="{:url('del?ids='.$vo['id'])}" href="javascript:;" title="删除">删除</a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>

    </form>
</div>
<div class="page-container p10">

    <div class="my-toolbar-box" >
        <div class="center mb10">
            
        </div>

        <div class="layui-btn-group">
        
        </div>
        <div class="layui-btn-group">
            <a data-href="{:url('lunboinfo')}" data-title="添加轮播广告" class="layui-btn layui-btn-primary j-iframe" data-width="800px" data-height="600px"><i class="layui-icon">&#xe654;</i>添加轮播广告</a>
        </div>
    </div>

     <form class="layui-form " method="post" id="pageListFormLunbo">
         <table class="layui-table" lay-size="sm">
            <thead>
            <tr>
                <th width="50">排序</th>
                <th width="100">广告图片</th>
                <th width="130">跳转链接</th>
                <th width="80">来源</th>
                <!--<th width="130">跳转方式</th>-->
                <!--<th width="130">广告名称</th>-->
                <th width="240">广告描述</th>
                <th width="80">状态</th>
                <th width="150">操作</th>
            </tr>
            </thead>

            {volist name="lunbolist" id="vo"}
            <tr>
                <td><input type="text" value="{$vo.lunboshunxu}" data-shunxu="lunboshunxu" data-id="{$vo.id}" class="layui-input shunxu" /></td>
                <td><img src="{$vo.pic}" style="border-radius: 0px;" /></td>
                <td>{$vo.jumpurl|default='无'}</td>
                <!--<td>-->
                <!--    {if condition="$vo.jumpstatus eq 0"}-->
                <!--        <font color="#666">App内</font>-->
                <!--    {/if}-->
                <!--    {if condition="$vo.jumpstatus eq 1"}-->
                <!--        <font color="#666">App外</font>-->
                <!--    {/if}-->
                <!--</td>-->
                <td>[{if condition="$vo.adtype == 0"}赛事-<span data-type_id="{$vo.type_id}"></span>{/if}{if condition="$vo.adtype == 1"}轮播{/if}]</td>
                <!--<td>{$vo.adname}</td>-->
                <td>{$vo.desc}</td>
                <td>
                    {if condition="$vo.status eq 0"}
                        <font color="#999">关闭</font>
                    {/if}
                    {if condition="$vo.status eq 1"}
                        <font color="green">开启</font>
                    {/if}
                    <a class="layui-btn layui-btn-xs changeStatus" href="javascript:;;" data-status="{$vo.status}" data-id="{$vo.id}">改状态</a>
                </td>
                <td>
                    <a class="layui-badge-rim j-iframe" data-title="编辑轮播广告" data-width="800px" data-height="600px" 
                    {if condition="$vo.adtype == 0"}
                        data-href="{:url('saishiinfo?id='.$vo['id'])}" 
                    {/if}
                    {if condition="$vo.adtype == 1"}
                        data-href="{:url('lunboinfo?id='.$vo['id'])}" 
                    {/if} href="javascript:;" title="编辑">编辑</a>
                    <a class="layui-badge-rim j-tr-del" data-href="{:url('del?ids='.$vo['id'])}" href="javascript:;" title="删除">删除</a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>

    </form>
</div>
<div class="page-container p10">

    <div class="my-toolbar-box" >
        <div class="center mb10">
            
        </div>

        <div class="layui-btn-group">
        
        </div>
        <div class="layui-btn-group">
            <a data-href="{:url('liebiaoinfo')}" data-title="添加列表广告"  class="layui-btn layui-btn-primary j-iframe" data-width="800px" data-height="600px"><i class="layui-icon">&#xe654;</i>添加列表广告</a>
        </div>
    </div>

     <form class="layui-form " method="post" id="pageListFormLiebiao">
         <table class="layui-table" lay-size="sm">
            <thead>
            <tr>
                <!--<th width="50">排序</th>-->
                <th width="100">广告图片</th>
                <th width="130">跳转链接</th>
                <!--<th width="130">跳转方式</th>-->
                <th width="130">所属模块</th>
                <th width="80">广告位置</th>
                <th width="80">状态</th>
                <th width="150">操作</th>
            </tr>
            </thead>

            {volist name="piclist" id="vo"}
            <tr>
                <!--<td><input type="text" value="{$vo.liebiaoshunxu}" data-shunxu="liebiaoshunxu" data-id="{$vo.id}" class="layui-input shunxu" /></td>-->
                <td><img src="{$vo.pic}" style="border-radius: 0px;" /></td>
                <td>{$vo.jumpurl}</td>
                <!--<td>-->
                <!--    {if condition="$vo.jumpstatus eq 0"}-->
                <!--        <font color="#666">App内</font>-->
                <!--    {/if}-->
                <!--    {if condition="$vo.jumpstatus eq 1"}-->
                <!--        <font color="#666">App外</font>-->
                <!--    {/if}-->
                <!--</td>-->
                <td>
                    {if condition="$vo.istuijian eq 0"}
                        <font color="#666">推荐</font>
                    {/if}
                    {if condition="$vo.istuijian eq 1"}
                        <font color="#666">发现</font>
                    {/if}
                    [<span data-istuijian="{$vo.istuijian}" data-mokuai_id="{$vo.mokuai_id}"></span>]
                </td>
                <td>
                    {if condition="$vo.picadweizhi eq 0"}
                        <font color="#666">[模块上面]</font>
                    {/if}
                    {if condition="$vo.picadweizhi eq 1"}
                        <font color="#666">[模块下面]</font>
                    {/if}
                </td>
                <td>
                    {if condition="$vo.status eq 0"}
                        <font color="#999">关闭</font>
                    {/if}
                    {if condition="$vo.status eq 1"}
                        <font color="green">开启</font>
                    {/if}
                    <a class="layui-btn layui-btn-xs changeStatus" href="javascript:;;" data-status="{$vo.status}" data-id="{$vo.id}">改状态</a>
                </td>
                <td>
                    <a class="layui-badge-rim j-iframe" data-title="编辑列表广告" data-width="800px" data-height="600px"  data-href="{:url('liebiaoinfo?id='.$vo['id'])}" href="javascript:;" title="编辑">编辑</a>
                    <a class="layui-badge-rim j-tr-del" data-href="{:url('del?ids='.$vo['id'])}" href="javascript:;" title="删除">删除</a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>

    </form>
</div>

<div class="page-container p10">
    <div class="my-toolbar-box" >
        <div class="center mb10">
            
        </div>
        <div class="layui-btn-group">
            
            {if condition="empty($kaiping)"}
            <a data-href="{:url('kaipinginfo')}" data-title="添加开屏广告" class="layui-btn layui-btn-primary j-iframe" data-width="800px" data-height="600px"><i class="layui-icon">&#xe654;</i>添加开屏广告</a>
            {/if}
            {if condition="!empty($kaiping)"}
            <a class="layui-btn layui-btn-primary j-iframe" data-title="编辑开屏广告" data-width="800px" data-height="600px"  data-href="{:url('kaipinginfo?id='.$kaiping['id'])}" href="javascript:;" title="编辑">编辑开屏广告</a>
            {/if}
        </div>

        <div class="layui-btn-group" style=" width: 100%;margin: 0;margin-top: 10px;">
            <img src="{$kaiping['pic']}" style="max-width: 300px;" />
        </div>
    </div>
    
</div>
<div class="page-container p10">
    <div class="my-toolbar-box" >
        <div class="center mb10">
            
        </div>

        <div class="layui-btn-group">
            {if condition="empty($xiangqing)"}
            <a data-href="{:url('xiangqinginfo')}" data-title="添加详情广告"  class="layui-btn layui-btn-primary j-iframe" data-width="800px" data-height="600px"><i class="layui-icon">&#xe654;</i>添加详情广告</a>
            {/if}
            {if condition="!empty($xiangqing)"}
            <a class="layui-btn layui-btn-primary j-iframe" data-title="编辑详情广告" data-width="800px" data-height="600px"  data-href="{:url('xiangqinginfo?id='.$xiangqing['id'])}" href="javascript:;" title="编辑">编辑详情广告</a>
            {/if}
        </div>

        <div class="layui-btn-group" style=" width: 100%;margin: 0;margin-top: 10px;">
            <img src="{$xiangqing['pic']}" style="max-width: 300px;" />
        </div>
    </div>
</div>
<div class="page-container p10">
    <div class="my-toolbar-box" >
        <div class="center mb10">
            
        </div>

        <div class="layui-btn-group">
            {if condition="empty($myad)"}
            <a data-href="{:url('myadinfo')}" data-title="添加个人中心广告"  class="layui-btn layui-btn-primary j-iframe" data-width="800px" data-height="600px"><i class="layui-icon">&#xe654;</i>添加个人中心广告</a>
            {/if}
            {if condition="!empty($myad)"}
            <a class="layui-btn layui-btn-primary j-iframe" data-title="编辑个人中心广告" data-width="800px" data-height="600px"  data-href="{:url('myadinfo?id='.$myad['id'])}" href="javascript:;" title="编辑">编辑个人中心广告</a>
            {/if}
        </div>

        <div class="layui-btn-group" style=" width: 100%;margin: 0;margin-top: 10px;">
            <img src="{$myad['pic']}" style="max-width: 300px;" />
        </div>
    </div>
</div>
{include file="../../../application/admin/view/public/foot" /}
<script type="text/javascript">
    var curUrl="{:url('banben/index',$param)}";
    layui.use(['form', 'laypage', 'jquery','layer'], function() {
        var laypage = layui.laypage
                , layer = layui.layer
                , $ = layui.jquery;
        function selectChangeTuijian() {
            $.post("/app.php/vod/getallrecommend", {'jiami':-1}, function(res) {
                if(res.code == 1) {
                    var list = res.data;//console.log(list)
                    if(list.length > 0) {
                        var str = "";
                        for(var i in list) {
                            $("span[data-istuijian='0'][data-mokuai_id='" + list[i].id + "']").html(list[i].name);
                        }
                    }
                }
            }, "json");
        }
        
        function selectChangeFaxian() {
            $.post("/app.php/vod/getallexplore", {'jiami':-1}, function(res) {
                if(res.code == 1) {
                    var list = res.data;//console.log(list)
                    if(list.length > 0) {
                        var str = "";
                        for(var i in list) {
                            if(list[i].childs.length > 0) {
                                for(var j in list[i].childs) {
                                    $("span[data-istuijian='1'][data-mokuai_id='" + list[i].childs[j].id + "']").html(list[i].childs[j].name);
                                }
                            }
                        }
                    }
                }
            }, "json");
        }
        selectChangeTuijian();
        selectChangeFaxian();
        
        $("input.shunxu").change(function() {
            var id = $(this).attr("data-id");
            var shunxutype = $(this).attr("data-shunxu");
            var shunxu = $(this).val();
            $.post("updateShunxu", {'jiami':-1, 'id': id, 'shunxutype': shunxutype, 'shunxu': shunxu}, function(res) {
                // console.log(res)
            }, "json");
        });
        
        
        $.post("/app.php/zhibo/getType", {'jiami':-1}, function(res) {
            if(res.code == 1) {
                var list = res.data.list;//console.log(list)
                if(list.length > 0) {
                    for(var i in list) {
                        $("span[data-type_id='" + list[i].id + "']").html(list[i].name);
                    }
                }
            }
        });
        
        $(".changeStatus").click(function() { 
            var t = $(this);
            var id = $(this).attr("data-id");
            var status = $(this).attr("data-status") == 0 ? 1 : 0;
            
            var index = layer.load(1);
            $.post("changeStatus", {'jiami':-1, id: id, status: status}, function(res) {
                layer.close(index); 
                if(res.code == 1) {
                    layer.msg('修改成功');
                    var statusStr = status == 0 ? '关闭' : '开启';
                    var statusStrCss = status == 0 ? '#999' : 'green';
                    t.parent().find("font").html(statusStr).css('color', statusStrCss);
                    t.attr("data-status", status);
                }
            });
        });
        
        $(".changeFrom").click(function() { 
            var t = $(this);
            var id = $(this).attr("data-id");
            var from = $(this).attr("data-from") == 0 ? 1 : 0;
            
            var index = layer.load(1);
            $.post("changeFrom", {'jiami':-1, id: id, from: from}, function(res) {
                layer.close(index); 
                if(res.code == 1) {
                    layer.msg('修改成功');
                    var fromStr = from == 0 ? '关闭' : '开启';
                    var fromStrCss = from == 0 ? '#999' : 'green';
                    t.parent().find("font").html(fromStr).css('color', fromStrCss);
                    t.attr("data-from", from);
                }
            });
        });
    });
</script>
</body>
</html>